# include <stdio.h>
 
int main()

{
	int i,j,k,n;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
		{
			if (j<=i)
			{
				printf("%4d",j);
			}
			else
			{
				printf("%4d",i);
			}
		}
		printf("\n");
	}
}

